<?php if( !$this->slot( 'sidebar' )->output( ) ) : ?>
<div>The sidebar wasn't filled.</div>
<?php endif; ?>
<?php $this->slot( 'sidebar' )->start( ); ?>
<div>The sidebar is filled.</div>
<?php $this->slot( 'sidebar' )->end( ); if( !$this->slot( 'sidebar' )->output( ) ) : ?>
This should not happen, as sidebar is now filled.
<?php endif; ?>